#	redos_bk script
#	Template for redo log backups.  This script must be modified
#	to point to your database files.
#	This example script uses UNIX Korn shell.
#
#	Step 1: Stop the archiving process.  This will keep
#	additional archived redo log files from being written
#	to the destination directory during this process.
#
sqldba lmode=y <<EOFarch1
archive log stop;
REM
REM	Exit SQLDBA, using the indicator set earlier.
exit
EOFarch1
#
# 		Step 2: Record which files are in the destination directory.
#  	Do this by setting an environment variable that is
#	equal to the directory listing for the destination directory.
#	For this example, the log_archive_dest is 
#	/db01/oracle/arch/CC1.
#
FILES=`ls /db01/oracle/arch/CC1/arch*.dbf`; export FILES
#
#		Step 3: Go back into SQLDBA and restart the 
#	archiving process.  Set an indicator (called EOFarch2 
#	in this example).
#
sqldba lmode=y <<EOFarch2
connect internal
archive log start;
exit
EOFarch2
#
#  	Step 4.  Back up the archived redo logs to the tape
#	device via the "tar" command, then delete them
# 	from the destination device via the "rm" command.
#
tar -rvf /dev/rmt/0hc $FILES
#
#		Step 5.  Delete those files from the destination directory.
#
rm -f $FILES
#
#	End of archived redo log file backup script.


